home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-13 / amac44c.zip / RFR004.QM < prev    next >
Text File  |  1992-06-22  |  52KB  |  980 lines

  1. *                               rfr004.qm
  2. *                 Macros to Right/Left Justify and Align
  3. *                        Written By Tom Hogshead
  4. *                       [ See RFRMxx.QM For Use ]
  5. *                                 6/13/92
  6. *  Key       Subfile                       Description
  7. * =====  ===============  ====================================================
  8. *--                Justify and Align Macros . .
  9. *  @0                     Left Justify Text in Line or Block  ( )         |new
  10. *                           to Designated Column
  11. *  @1                     Right Justify Column Block
  12. *  @2                     Left  Justify Column Block
  13. *  @3                     Align Column Block by Decimal Point
  14. *  @4                     Align Column Block by Decimal Point, Fill Zeros
  15. *  @5                     Comma Delineate and Align Column Block
  16. *                           by Decimal Point, Fill with Zeros
  17. *  @6                     Comma Delineate and Align Column Block
  18. *                           by Decimal Point, Fill with Zeros, Add $'s
  19. *  @9                     Right Justify Paragraph                         |chg
  20. *  @f7                    Left  Justify Any Type Block
  21. *  @f8                    Left  Justify File
  22. *
  23. *--                Right Justify Using RJ.COM . .
  24. *  @f1                    Right Justify Block Using RJ.COM
  25. *  @f2                    Removes Right Justification from Block
  26. *  @f3                    Right Justify File Using RJ.COM
  27. *  @f4                    Removes Right Justification from File
  28. *  @f5                    Right Justify File Using RJ.COM, Screen Preview
  29. *--                Other Column Block Macros . .
  30. *  @7  {e:\up\mis003}  Make Column Block Longest Line in Block
  31. *  @2  {e:\up\mis003}  Make Column Block Longest Line in Paragraph
  32. *  @6  {e:\up\mis003}  Make Column Block Longest Line in File
  33. *  @1  {e:\up\mis003}  Make Column Block Longest Line
  34. *  @3  {e:\up\mis003}  Make Column Block Longest Line, Exclude Leading Spcs
  35. *  @4  {e:\up\mis003}  Convert Any Block to Column Block 73 Column Wide
  36. *
  37. *       {e:\up\RFRM*}  Return To RFRMxx.QM
  38. *
  39. *   Documentation for RJ.COM
  40. *
  41. *-- eoi
  42.  
  43.  
  44. * 
  45. *    ┌─────────────────┐
  46. *    │123456789        │
  47. *    │    123456789.1  │
  48. *    │123456789.12     │
  49. * ┌──┤    123456789.123│  <── Numbers marked as a column block
  50. * │  │123456789        │
  51. * │  │    123456789.1  │
  52. * │  │123456789.12     │
  53. * │  │    123456789.123│
  54. * │  └─────────────────┘      Become this 
  55. * │
  56. * │   @1 Right Justify        @2 Left Justify            @3 Align
  57. * │  ┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
  58. * │  │        123456789│    │123456789        │    │    123456789    │
  59. * │  │      123456789.1│    │123456789.1      │    │    123456789.1  │
  60. * │  │     123456789.12│    │123456789.12     │    │    123456789.12 │
  61. * │  │    123456789.123│    │123456789.123    │    │    123456789.123│
  62. * ├──┤        123456789│    │123456789        │    │    123456789    │
  63. * │  │      123456789.1│    │123456789.1      │    │    123456789.1  │
  64. * │  │     123456789.12│    │123456789.12     │    │    123456789.12 │
  65. * │  │    123456789.123│    │123456789.123    │    │    123456789.123│
  66. * │  └─────────────────┘    └─────────────────┘    └─────────────────┘
  67. * │
  68. * │   @4 Align/Fill Zeros    @5 Align/Fill Zeros,  @6 Align/Fill Zeros,
  69. * │                             Add Commas            Add Commas and $'s
  70. * │  ┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
  71. * │  │    123456789.000│    │  123,456,789.000│    │ $123,456,789.000│
  72. * │  │    123456789.100│    │  123,456,789.100│    │ $123,456,789.100│
  73. * │  │    123456789.120│    │  123,456,789.120│    │ $123,456,789.120│
  74. * │  │    123456789.123│    │  123,456,789.123│    │ $123,456,789.123│
  75. * └──┤    123456789.000│    │  123,456,789.000│    │ $123,456,789.000│
  76. *    │    123456789.100│    │  123,456,789.100│    │ $123,456,789.100│
  77. *    │    123456789.120│    │  123,456,789.120│    │ $123,456,789.120│
  78. *    │    123456789.123│    │  123,456,789.123│    │ $123,456,789.123│
  79. *    └─────────────────┘    └─────────────────┘    └─────────────────┘
  80.  
  81.  
  82. *                          M A C R O S
  83. * --------------------------------------------------------------------
  84. * @(1) Right Justify Column Block, Ver. 2
  85. * --------------------------------------------------------------------
  86. *        This                               This
  87. *   ┌── + ─── + ───┐                ┌─────────────────┐
  88. *   │         3    │                │123456789        │
  89. *   │1234.56       │                │    123456789.1  │
  90. *   │              │                │123456789.12     │
  91. *   │  .02         │                │    123456789.123│
  92. *   │       213.679│                │123456789        │
  93. *   │     432.0    │                │    123456789.1  │
  94. *   └──────────────┘                │123456789.12     │
  95. *                                   │    123456789.123│
  96. *                                   └─────────────────┘
  97. *    Becomes this                     Becomes this
  98. *   ┌── + ─── + ───┐                ┌─────────────────┐
  99. *   │             3│                │        123456789│
  100. *   │       1234.56│                │      123456789.1│
  101. *   │              │                │     123456789.12│
  102. *   │           .02│                │    123456789.123│
  103. *   │       213.679│                │        123456789│
  104. *   │         432.0│                │      123456789.1│
  105. *   └──────────────┘                │     123456789.12│
  106. *                                   │    123456789.123│
  107. *                                   └─────────────────┘
  108.  
  109. @1      macrobegin
  110.         setscreenoff
  111.         editfile "nul" return quit gotoblockbeg jfalse END editfile return
  112.         copyblock gotoblockend cursorleft addline #173 cursorup
  113.   LOOP:
  114.         unmarkblock markcolumn endline                                     *|
  115.         cut begline paste endline jtrue EMPTY gotoblockend
  116.  EMPTY:
  117.         cursorleft cursorup jtrue LOOP begfile cursorright
  118.         markcolumn endfile cursorup                                        *|
  119.         copy quit pasteover
  120.    END: unmarkblock
  121. *
  122. * 50 bytes Mon  03-18-1991  21:52:05 (RB #f8, #24/317)
  123. * 54 bytes Mon  01-13-1992  08:38:54 (TH @1, changed loop algorithm)
  124. * 54 bytes Mon  03-30-1992  17:40:55 (TH @1, to GG #20/487)
  125. * 52 bytes Tue  03-31-1992  09:47:19 (TH @1, v2, removed extra markcolumn's)
  126. * 52 bytes Tue  03-31-1992  09:47:19 (TH @1, to All #3/827-828)
  127. * 52 bytes Tue  03-31-1992  09:47:19 (TH @1, to All #3/829-830)
  128.  
  129. * 
  130. * --------------------------------------------------------------------
  131. * @(2) Left Justify Column Block, Ver. 3, (Mod to R. Blackburn Macro)
  132. * --------------------------------------------------------------------
  133. *        This                               This
  134. *   ┌── + ─── + ───┐                ┌─────────────────┐
  135. *   │         3    │                │123456789        │
  136. *   │1234.56       │                │    123456789.1  │
  137. *   │              │                │123456789.12     │
  138. *   │  .02         │                │    123456789.123│
  139. *   │       213.679│                │123456789        │
  140. *   │     432.0    │                │    123456789.1  │
  141. *   └──────────────┘                │123456789.12     │
  142. *                                   │    123456789.123│
  143. *                                   └─────────────────┘
  144. *    Becomes this                     Becomes this
  145. *   ┌── + ─── + ───┐                ┌─────────────────┐
  146. *   │3             │                │123456789        │
  147. *   │1234.56       │                │123456789.1      │
  148. *   │              │                │123456789.12     │
  149. *   │.02           │                │123456789.123    │
  150. *   │213.679       │                │123456789        │
  151. *   │432.0         │                │123456789.1      │
  152. *   └──────────────┘                │123456789.12     │
  153. *                                   │123456789.123    │
  154. *                                   └─────────────────┘
  155.  
  156. @2      MacroBegin
  157.         setscreenoff                                                       *|
  158.         EditFile "nul" Return Quit      * Quit nul file if loaded
  159.         GotoBlockBeg JFalse END         * Position cursor for paste back   *|
  160.         EditFile Return                 * Load empty nul file
  161.         "a" Return                      * Insert "a" in column to align
  162.                                         * text below left justified
  163.         CopyBlock                       * Copy block to justify to nul
  164.  Label0:
  165.         Align                           * Justify line left
  166.         JTrue Label0                    * and do until no more to do
  167.         Cut                             * Then cut block to scrap
  168.         Quit                            * Quit nul file
  169.         PasteOver                       * And paste it where we were
  170.         UnmarkBlock                     * Unmark left justified block
  171.  END:                                                                      *|
  172. *
  173. * 28 bytes Mon  03-18-1991  21:51:51 (RB #f7, #24/317)
  174. * 29 bytes Mon  01-13-1992  08:59:29 (TH @2, v2.15 reqd.)
  175. * 29 bytes Mon  03-30-1992  15:43:35 (TH @2, to GG #20/487)
  176. * 32 bytes Thu  04-02-1992  07:23:55 (TH @2, end macro if no block, Ver. 3)
  177. * 32 bytes Thu  04-02-1992  07:23:55 (TH @2, to All #3/827-828)
  178. * 32 bytes Thu  04-02-1992  07:23:55 (TH @2, to All #3/829-830)
  179.  
  180. * 
  181. * --------------------------------------------------------------------
  182. * @(3) Align Column Block By Decimal Point, Ver. 3
  183. * --------------------------------------------------------------------
  184. *        This                               This
  185. *   ┌── + ─── + ───┐                ┌─────────────────┐
  186. *   │         3    │                │123456789        │
  187. *   │1234.56       │                │    123456789.1  │
  188. *   │              │                │123456789.12     │
  189. *   │  .02         │                │    123456789.123│
  190. *   │       213.679│                │123456789        │
  191. *   │     432.0    │                │    123456789.1  │
  192. *   └──────────────┘                │123456789.12     │
  193. *                                   │    123456789.123│
  194. *                                   └─────────────────┘
  195. *    Becomes this                     Becomes this
  196. *   ┌── + ─── + ───┐                ┌─────────────────┐
  197. *   │         3    │                │    123456789    │
  198. *   │      1234.56 │                │    123456789.1  │
  199. *   │              │                │    123456789.12 │
  200. *   │          .02 │                │    123456789.123│
  201. *   │       213.679│                │    123456789    │
  202. *   │       432.0  │                │    123456789.1  │
  203. *   └──────────────┘                │    123456789.12 │
  204. *                                   │    123456789.123│
  205. *                                   └─────────────────┘
  206.  
  207. @3          macrobegin
  208.             setscreenoff
  209.             savesettings setsoundoff setwordwrapmode togglewordwrap
  210.             editfile "nul" return quit gotoblockbeg jfalse END
  211.             editfile return copyblock markline
  212. *  *── Add This Line to Have Dollar Signs  ───────────────────────────────┐
  213. *           findreplace "$" return " " return "gn" return             *   │
  214. *  *-─────────────────────────────────────────────────────────────────────┘
  215. * -------------------- Find Decimal Point Line 1 -------------------*
  216.             find "." return "L" return jtrue DOT1 endline
  217. *  *── To Fill With Zeros,  Uncomment This Line ──────────────────────────┐
  218. *           jfalse DOT1 "." cursorleft                                *   │
  219. *  *-─────────────────────────────────────────────────────────────────────┘
  220.     DOT1:   unmarkblock markcolumn endline storescrbuff "x" return cut
  221.     LINE:   cursordown jfalse FIN
  222.             begline unmarkblock markline
  223. * -------------------- Find Decimal Point Line 2+ ------------------*
  224.             find return "L" return jtrue DOT2 endline
  225. *  *── To Fill With Zeros,  Uncomment This Line ──────────────────────────┐
  226. *           jfalse DOT2 "." cursorleft                                *   │
  227. *  *-─────────────────────────────────────────────────────────────────────┘
  228. * ---------- Append Decimal Point + Fraction to Buffer "x" ---------*
  229.     DOT2:   unmarkblock markcolumn endline appendscrbuff "x" return cut
  230.             jump LINE
  231. * ------------ Make Numbers w/o Fractions a Column Block -----------*
  232.     FIN:    begfile markcolumn
  233.     1A:     endline 2A: cursorleft markcolumn cursordown jfalse 4A
  234.     3A:     jump 1A 4A: gotoblockend cursorleft addline #173 cursorup
  235. *  *─- Add This Line to Comma Delineate Columns  ─────────────────────────┐
  236. *           findreplace "," return delline return "gn" return         *   │
  237. *  *-─────────────────────────────────────────────────────────────────────┘
  238. * --------------- Right Justify Numbers w/o Fractions --------------*
  239.     LOOP:   unmarkblock markcolumn endline
  240.             cut begline paste endline jtrue EMPTY gotoblockend
  241.     EMPTY:  cursorleft cursorup jtrue LOOP
  242.             begfile cursorright unmarkblock markcolumn endfile cursorup
  243. *  *─- Add These Lines to Comma Delineate Columns ────────────────────────┐
  244. *           markcolumn cursorright                                    *   │
  245. *   COMMA_SPACE:                                                      *   │
  246. *           cursorleft cursorleft cursorleft                          *   │
  247. *           cursorleft jfalse ADD_COMMA                               *   │
  248. *           isbegline jtrue ADD_COMMA                                 *   │
  249. *           gotoblockbeg markcolumn prevposition shiftleft            *   │
  250. *           jump COMMA_SPACE                                          *   │
  251. *   ADD_COMMA:                                                        *   │
  252. *           endfile cursorup markcolumn begfile                       *   │
  253. *           findreplace " "   return ","   return "n"  return         *   │
  254. *           findreplace ",,"  return "  "  return "n"  return         *   │
  255. *           findreplace " ,"  return "  "  return "n"  return         *   │
  256. *  *-─────────────────────────────────────────────────────────────────────┘
  257. *  *── Add These 2 Lines to Have Dollar Signs  ───────────────────────────┐
  258. *           setinsmode toggleinsert                                   *   │
  259. *   DOLLAR: firstnonwhite cursorleft "$" cursordown jtrue DOLLAR      *   │
  260. *  *-─────────────────────────────────────────────────────────────────────┘
  261. * ------------- Paste Right Justified Whole Numbers Back -----------*
  262.             copy quit pasteover
  263. * --------- Make Column Block of Decimal Points + Fractions --------*
  264.             gotoblockend markline gotoblockbeg
  265.             editfile return getscrbuff "x" return unmarkblock markcolumn
  266.     1B:     endline 2B: cursorleft markcolumn cursordown jfalse 4B
  267.     3B:     jump 1B 4B:
  268. *  *── To Fill With Trailing Zeros,  Uncomment These 2 Lines ─────────────┐
  269. *           gotoblockbeg copy paste                                   *   │
  270. *           findreplace " " return "0" return "ln" return             *   │
  271. *  *-─────────────────────────────────────────────────────────────────────┘
  272.             copy quit pasteover     * Paste decimal points + fractions back
  273. *  *── To Add Leading Zero, Uncomment These 2 Lines ──────────────────────┐
  274. *           cursorleft cursorleft markcolumn                          *   │
  275. *           findreplace " ."  return "0."  return "ln" return         *   │
  276. *  *──────────────────────────────────────────────────────────────────────┘
  277. *  *── Add This Line to Have Dollar Signs  ───────────────────────────────┐
  278. *           findreplace " 0." return "$0." return "ln" return         *   │
  279. *  *──────────────────────────────────────────────────────────────────────┘
  280.     END:    unmarkblock begline restoresettings
  281. *
  282. * 142 bytes Mon  03-30-1992  17:54:35 (TH @3, Ver. 1, to GG #20/487)
  283. * 151 bytes Tue  03-31-1992  11:21:58 (TH @3, for all wordwraps and #'s)
  284. * 151 bytes Tue  03-31-1992  11:21:58 (TH @3, Ver. 2, to GG #20/491)
  285. * 142 bytes Tue  03-31-1992  17:57:57 (TH @3, Ver. 3, shortened)
  286. * 142 bytes Tue  03-31-1992  17:57:57 (TH @3, Ver. 3, to GG #20/492)
  287. * 142 bytes Tue  03-31-1992  17:57:57 (TH @3, to All #3/827-828)
  288. * 142 bytes Tue  03-31-1992  17:57:57 (TH @3, to All #3/829-830)
  289.  
  290. * 
  291. * --------------------------------------------------------------------
  292. * @(4) Align Column Block By Decimal Point,
  293. *      Fill With Leading/Trailing Zeros, Ver. 2
  294. * --------------------------------------------------------------------
  295. *        This                               This
  296. *   ┌── + ─── + ───┐                ┌─────────────────┐
  297. *   │         3    │                │123456789        │
  298. *   │1234.56       │                │    123456789.1  │
  299. *   │              │                │123456789.12     │
  300. *   │  .02         │                │    123456789.123│
  301. *   │       213.679│                │123456789        │
  302. *   │     432.0    │                │    123456789.1  │
  303. *   └──────────────┘                │123456789.12     │
  304. *                                   │    123456789.123│
  305. *                                   └─────────────────┘
  306. *    Becomes this                     Becomes this
  307. *   ┌── + ─── + ───┐                ┌─────────────────┐
  308. *   │         3.000│                │    123456789.000│
  309. *   │      1234.560│                │    123456789.100│
  310. *   │              │                │    123456789.120│
  311. *   │         0.020│                │    123456789.123│
  312. *   │       213.679│                │    123456789.000│
  313. *   │       432.000│                │    123456789.100│
  314. *   └──────────────┘                │    123456789.120│
  315. *                                   │    123456789.123│
  316. *                                   └─────────────────┘
  317.  
  318. @4          macrobegin
  319.             setscreenoff
  320.             savesettings setsoundoff setwordwrapmode togglewordwrap
  321.             editfile "nul" return quit gotoblockbeg jfalse END
  322.             editfile return copyblock markline
  323. *  *── Add This Line to Have Dollar Signs  ───────────────────────────────┐
  324. *           findreplace "$" return " " return "gn" return             *   │
  325. *  *-─────────────────────────────────────────────────────────────────────┘
  326. * -------------------- Find Decimal Point Line 1 -------------------*
  327.             find "." return "L" return jtrue DOT1 endline
  328.  *── To Fill With Zeros,  Uncomment This Line ──────────────────────────┐
  329.           jfalse DOT1 "." cursorleft                                *   │
  330.  *-─────────────────────────────────────────────────────────────────────┘
  331.     DOT1:   unmarkblock markcolumn endline storescrbuff "x" return cut
  332.     LINE:   cursordown jfalse FIN
  333.             begline unmarkblock markline
  334. * -------------------- Find Decimal Point Line 2+ ------------------*
  335.             find return "L" return jtrue DOT2 endline
  336.  *── To Fill With Zeros,  Uncomment This Line ──────────────────────────┐
  337.           jfalse DOT2 "." cursorleft                                *   │
  338.  *-─────────────────────────────────────────────────────────────────────┘
  339. * ---------- Append Decimal Point + Fraction to Buffer "x" ---------*
  340.     DOT2:   unmarkblock markcolumn endline appendscrbuff "x" return cut
  341.             jump LINE
  342. * ------------ Make Numbers w/o Fractions a Column Block -----------*
  343.     FIN:    begfile markcolumn
  344.     1A:     endline 2A: cursorleft markcolumn cursordown jfalse 4A
  345.     3A:     jump 1A 4A: gotoblockend cursorleft addline #173 cursorup
  346. *  *─- Add This Line to Comma Delineate Columns  ─────────────────────────┐
  347. *           findreplace "," return delline return "gn" return         *   │
  348. *  *-─────────────────────────────────────────────────────────────────────┘
  349. * --------------- Right Justify Numbers w/o Fractions --------------*
  350.     LOOP:   unmarkblock markcolumn endline
  351.             cut begline paste endline jtrue EMPTY gotoblockend
  352.     EMPTY:  cursorleft cursorup jtrue LOOP
  353.             begfile cursorright unmarkblock markcolumn endfile cursorup
  354. *  *─- Add These Lines to Comma Delineate Columns ────────────────────────┐
  355. *           markcolumn cursorright                                    *   │
  356. *   COMMA_SPACE:                                                      *   │
  357. *           cursorleft cursorleft cursorleft                          *   │
  358. *           cursorleft jfalse ADD_COMMA                               *   │
  359. *           isbegline jtrue ADD_COMMA                                 *   │
  360. *           gotoblockbeg markcolumn prevposition shiftleft            *   │
  361. *           jump COMMA_SPACE                                          *   │
  362. *   ADD_COMMA:                                                        *   │
  363. *           endfile cursorup markcolumn begfile                       *   │
  364. *           findreplace " "   return ","   return "n"  return         *   │
  365. *           findreplace ",,"  return "  "  return "n"  return         *   │
  366. *           findreplace " ,"  return "  "  return "n"  return         *   │
  367. *  *-─────────────────────────────────────────────────────────────────────┘
  368. *  *── Add These 2 Lines to Have Dollar Signs  ───────────────────────────┐
  369. *           setinsmode toggleinsert                                   *   │
  370. *   DOLLAR: firstnonwhite cursorleft "$" cursordown jtrue DOLLAR      *   │
  371. *  *-─────────────────────────────────────────────────────────────────────┘
  372. * ------------- Paste Right Justified Whole Numbers Back -----------*
  373.             copy quit pasteover
  374. * --------- Make Column Block of Decimal Points + Fractions --------*
  375.             gotoblockend markline gotoblockbeg
  376.             editfile return getscrbuff "x" return unmarkblock markcolumn
  377.     1B:     endline 2B: cursorleft markcolumn cursordown jfalse 4B
  378.     3B:     jump 1B 4B:
  379.  *── To Fill With Trailing Zeros,  Uncomment These 2 Lines ─────────────┐
  380.           gotoblockbeg copy paste                                   *   │
  381.           findreplace " " return "0" return "ln" return             *   │
  382.  *-─────────────────────────────────────────────────────────────────────┘
  383.             copy quit pasteover     * Paste decimal points + fractions back
  384.  *── To Add Leading Zero, Uncomment These 2 Lines ──────────────────────┐
  385.           cursorleft cursorleft markcolumn                          *   │  *|
  386.           findreplace " ."  return "0."  return "ln" return         *   │
  387.  *──────────────────────────────────────────────────────────────────────┘
  388. *  *── Add This Line to Have Dollar Signs  ───────────────────────────────┐
  389. *           findreplace " 0." return "$0." return "ln" return         *   │
  390. *  *──────────────────────────────────────────────────────────────────────┘
  391.     END:    unmarkblock begline restoresettings
  392. *
  393. * 187 bytes Tue  03-31-1992  18:05:29 (TH @4, to GG #20/492)
  394. * 187 bytes Tue  03-31-1992  18:05:29 (TH @4, to All #3/827-828)
  395. * 188 bytes Wed  04-08-1992  11:24:48 (TH @4, Ver.2, added cursorleft *|)
  396. * 188 bytes Wed  04-08-1992  11:24:48 (TH @4, to All #3/829-830)
  397.  
  398.  
  399. * 
  400. * --------------------------------------------------------------------
  401. * @(5) Comma Delineate and Align Column Block By Decimal Point,
  402. *      Fill With Leading/Trailing Zeros, Ver. 2
  403. * --------------------------------------------------------------------
  404. *        This                               This
  405. *   ┌── + ─── + ───┐                ┌─────────────────┐
  406. *   │         3    │                │123456789        │
  407. *   │1234.56       │                │    12345678o.1  │
  408. *   │              │                │123456789.12     │
  409. *   │  .02         │                │    123456789.123│
  410. *   │       213.679│                │123456789        │
  411. *   │     432.0    │                │    123456789.1  │
  412. *   └──────────────┘                │123456789.12     │
  413. *                                   │    123456789.123│
  414. *                                   └─────────────────┘
  415. *    Becomes this                     Becomes this
  416. *   ┌── + ─── + ───┐                ┌─────────────────┐
  417. *   │         3.000│                │  123,456,789.000│
  418. *   │     1,234.560│                │  123,456,789.100│
  419. *   │              │                │  123,456,789.120│
  420. *   │         0.020│                │  123,456,789.123│
  421. *   │       213.679│                │  123,456,789.000│
  422. *   │       432.000│                │  123,456,789.100│
  423. *   └──────────────┘                │  123,456,789.120│
  424. *                                   │  123,456,789.123│
  425. *                                   └─────────────────┘
  426.  
  427. @5          macrobegin
  428.             setscreenoff
  429.             savesettings setsoundoff setwordwrapmode togglewordwrap
  430.             editfile "nul" return quit gotoblockbeg jfalse END
  431.             editfile return copyblock markline
  432. * -------------------- Find Decimal Point Line 1 -------------------*
  433.             find "." return "L" return jtrue DOT1 endline
  434.  *── To Fill With Zeros,  Uncomment This Line ──────────────────────────┐
  435.           jfalse DOT1 "." cursorleft                                *   │
  436.  *-─────────────────────────────────────────────────────────────────────┘
  437.     DOT1:   unmarkblock markcolumn endline storescrbuff "x" return cut
  438.     LINE:   cursordown jfalse FIN
  439.             begline unmarkblock markline
  440. * -------------------- Find Decimal Point Line 2+ ------------------*
  441.             find return "L" return jtrue DOT2 endline
  442.  *── To Fill With Zeros,  Uncomment This Line ──────────────────────────┐
  443.           jfalse DOT2 "." cursorleft                                *   │
  444.  *-─────────────────────────────────────────────────────────────────────┘
  445. * ---------- Append Decimal Point + Fraction to Buffer "x" ---------*
  446.     DOT2:   unmarkblock markcolumn endline appendscrbuff "x" return cut
  447.             jump LINE
  448. * ------------ Make Numbers w/o Fractions a Column Block -----------*
  449.     FIN:    begfile markcolumn
  450.     1A:     endline 2A: cursorleft markcolumn cursordown jfalse 4A
  451.     3A:     jump 1A 4A: gotoblockend cursorleft addline #173 cursorup
  452.  *─- Add This Line to Comma Delineate Columns  ─────────────────────────┐
  453.           findreplace "," return delline return "gn" return         *   │
  454.  *-─────────────────────────────────────────────────────────────────────┘
  455. * --------------- Right Justify Numbers w/o Fractions --------------*
  456.     LOOP:   unmarkblock markcolumn endline
  457.             cut begline paste endline jtrue EMPTY gotoblockend
  458.     EMPTY:  cursorleft cursorup jtrue LOOP
  459.             begfile cursorright unmarkblock markcolumn endfile cursorup
  460.  *─- Add These Lines to Comma Delineate Columns ────────────────────────┐
  461.           markcolumn cursorright                                    *   │
  462.   COMMA_SPACE:                                                      *   │
  463.           cursorleft cursorleft cursorleft                          *   │
  464.           cursorleft jfalse ADD_COMMA                               *   │
  465.           isbegline jtrue ADD_COMMA                                 *   │
  466.           gotoblockbeg markcolumn prevposition shiftleft            *   │
  467.           jump COMMA_SPACE                                          *   │
  468.   ADD_COMMA:                                                        *   │
  469.           endfile cursorup markcolumn gotoblockbeg                  *   │
  470.           findreplace " "   return ","   return "ln" return         *   │
  471.           begfile                                                   *   │
  472.           findreplace ",,"  return "  "  return "n"  return         *   │
  473.           findreplace " ,"  return "  "  return "n"  return         *   │
  474.  *-─────────────────────────────────────────────────────────────────────┘
  475. * ------------- Paste Right Justified Whole Numbers Back -----------*
  476.             copy quit pasteover
  477. * --------- Make Column Block of Decimal Points + Fractions --------*
  478.             gotoblockend markline gotoblockbeg
  479.             editfile return getscrbuff "x" return unmarkblock markcolumn
  480.     1B:     endline 2B: cursorleft markcolumn cursordown jfalse 4B
  481.     3B:     jump 1B 4B:
  482.  *── To Fill With Trailing Zeros,  Uncomment These 2 Lines ─────────────┐
  483.           gotoblockbeg copy paste                                   *   │
  484.           findreplace " " return "0" return "ln" return             *   │
  485.  *-─────────────────────────────────────────────────────────────────────┘
  486.             copy quit pasteover     * Paste decimal points + fractions back
  487.  *── To Add Leading Zero, Uncomment These 2 Lines ──────────────────────┐
  488.           cursorleft cursorleft markcolumn                          *   │  *|
  489.           findreplace " ." return "0." return "ln" return           *   │
  490.  *──────────────────────────────────────────────────────────────────────┘
  491.     END:    unmarkblock begline restoresettings
  492. *
  493. * 263 bytes Tue  04-07-1992  19:24:54 (TH @5)
  494. * 263 bytes Tue  04-07-1992  19:24:54 (TH @5, to All #3/827-828)
  495. * 264 bytes Wed  04-08-1992  11:31:13 (TH @5, Ver. 2, added cursorleft *|)
  496. * 264 bytes Wed  04-08-1992  11:31:13 (TH @5, to All #3/829-830)
  497.  
  498. * 
  499. * --------------------------------------------------------------------
  500. * @(6) Comma Delineate and Align Column Block By Decimal Point,
  501. *      Fill With Leading/Trailing Zeros, Add Dollar Signs, Ver. 2
  502. * --------------------------------------------------------------------
  503. *        This                               This
  504. *   ┌── + ─── + ───┐                ┌─────────────────┐
  505. *   │         3    │                │123456789        │
  506. *   │1234.56       │                │    123456789.1  │
  507. *   │              │                │123456789.12     │
  508. *   │  .02         │                │    123456789.123│
  509. *   │       213.679│                │123456789        │
  510. *   │     432.0    │                │    123456789.1  │
  511. *   └──────────────┘                │123456789.12     │
  512. *                                   │    123456789.123│
  513. *                                   └─────────────────┘
  514. *    Becomes this                     Becomes this
  515. *   ┌── + ─── + ───┐                ┌─────────────────┐
  516. *   │        $3.000│                │ $123,456,789.000│
  517. *   │    $1,234.560│                │ $123,456,789.100│
  518. *   │              │                │ $123,456,789.120│
  519. *   │        $0.020│                │ $123,456,789.123│
  520. *   │      $213.679│                │ $123,456,789.000│
  521. *   │      $432.000│                │ $123,456,789.100│
  522. *   └──────────────┘                │ $123,456,789.120│
  523. *                                   │ $123,456,789.123│
  524. *                                   └─────────────────┘
  525.  
  526. @6          macrobegin
  527.             setscreenoff
  528.             savesettings setsoundoff setwordwrapmode togglewordwrap
  529.             editfile "nul" return quit gotoblockbeg jfalse END
  530.             editfile return copyblock markline
  531.  *── Add This Line to Have Dollar Signs  ───────────────────────────────┐
  532.           findreplace "$" return " " return "gn" return             *   │
  533.  *-─────────────────────────────────────────────────────────────────────┘
  534. * -------------------- Find Decimal Point Line 1 -------------------*
  535.             find "." return "L" return jtrue DOT1 endline
  536.  *── To Fill With Zeros,  Uncomment This Line ──────────────────────────┐
  537.           jfalse DOT1 "." cursorleft                                *   │
  538.  *-─────────────────────────────────────────────────────────────────────┘
  539.     DOT1:   unmarkblock markcolumn endline storescrbuff "x" return cut
  540.     LINE:   cursordown jfalse FIN
  541.             begline unmarkblock markline
  542. * -------------------- Find Decimal Point Line 2+ ------------------*
  543.             find return "L" return jtrue DOT2 endline
  544.  *── To Fill With Zeros,  Uncomment This Line ──────────────────────────┐
  545.           jfalse DOT2 "." cursorleft                                *   │
  546.  *-─────────────────────────────────────────────────────────────────────┘
  547. * ---------- Append Decimal Point + Fraction to Buffer "x" ---------*
  548.     DOT2:   unmarkblock markcolumn endline appendscrbuff "x" return cut
  549.             jump LINE
  550. * ------------ Make Numbers w/o Fractions a Column Block -----------*
  551.     FIN:    begfile markcolumn
  552.     1A:     endline 2A: cursorleft markcolumn cursordown jfalse 4A
  553.     3A:     jump 1A 4A: gotoblockend cursorleft addline #173 cursorup
  554.  *─- Add This Line to Comma Delineate Columns  ─────────────────────────┐
  555.           findreplace "," return delline return "gn" return         *   │
  556.  *-─────────────────────────────────────────────────────────────────────┘
  557. * --------------- Right Justify Numbers w/o Fractions --------------*
  558.     LOOP:   unmarkblock markcolumn endline
  559.             cut begline paste endline jtrue EMPTY gotoblockend
  560.     EMPTY:  cursorleft cursorup jtrue LOOP
  561.             begfile cursorright unmarkblock markcolumn endfile cursorup
  562.  *─- Add These Lines to Comma Delineate Columns ────────────────────────┐
  563.           markcolumn cursorright                                    *   │
  564.   COMMA_SPACE:                                                      *   │
  565.           cursorleft cursorleft cursorleft                          *   │
  566.           cursorleft jfalse ADD_COMMA                               *   │
  567.           isbegline jtrue ADD_COMMA                                 *   │
  568.           gotoblockbeg markcolumn prevposition shiftleft            *   │
  569.           jump COMMA_SPACE                                          *   │
  570.   ADD_COMMA:                                                        *   │
  571.           endfile cursorup markcolumn begfile                       *   │
  572.           findreplace " "   return ","   return "n"  return         *   │
  573.           findreplace ",,"  return "  "  return "n"  return         *   │
  574.           findreplace " ,"  return "  "  return "n"  return         *   │
  575.  *-─────────────────────────────────────────────────────────────────────┘
  576.  *── Add These 2 Lines to Have Dollar Signs  ───────────────────────────┐
  577.           setinsmode toggleinsert                                   *   │
  578.   DOLLAR: firstnonwhite cursorleft "$" cursordown jtrue DOLLAR      *   │
  579.  *-─────────────────────────────────────────────────────────────────────┘
  580. * ------------- Paste Right Justified Whole Numbers Back -----------*
  581.             copy quit pasteover
  582. * --------- Make Column Block of Decimal Points + Fractions --------*
  583.             gotoblockend markline gotoblockbeg
  584.             editfile return getscrbuff "x" return unmarkblock markcolumn
  585.     1B:     endline 2B: cursorleft markcolumn cursordown jfalse 4B
  586.     3B:     jump 1B 4B:
  587.  *── To Fill With Trailing Zeros,  Uncomment These 2 Lines ─────────────┐
  588.           gotoblockbeg copy paste                                   *   │
  589.           findreplace " " return "0" return "ln" return             *   │
  590.  *-─────────────────────────────────────────────────────────────────────┘
  591.             copy quit pasteover     * Paste decimal points + fractions back
  592.  *── To Add Leading Zero, Uncomment These 2 Lines ──────────────────────┐
  593.           cursorleft cursorleft markcolumn                          *   │
  594.           findreplace " ."  return "0."  return "ln" return         *   │
  595.  *──────────────────────────────────────────────────────────────────────┘
  596.  *── Add This Line to Have Dollar Signs  ───────────────────────────────┐
  597.           findreplace " 0." return "$0." return "ln" return         *   │
  598.  *──────────────────────────────────────────────────────────────────────┘
  599.     END:    unmarkblock begline restoresettings
  600. *
  601. * 306 bytes Tue  04-07-1992  22:45:28 (TH @6)
  602. * 306 bytes Tue  04-07-1992  22:45:28 (TH @6, to All #3/827-828)
  603. * 303 bytes Wed  04-08-1992  09:21:16 (TH @6, Ver. 2, shortened)
  604. * 303 bytes Wed  04-08-1992  09:21:16 (TH @6, to All #3/829-830)
  605.  
  606. * 
  607. * ----------------------------------------------------------------------
  608. * @(9) Right Justify Paragraph, QEdit v2.15 Only
  609. * ----------------------------------------------------------------------
  610. * This macro will right justify any column that is a paragraph, i.e.
  611. * delineated by blank lines on top and bottom.  If the paragraph is at
  612. * the eof and does not have a blank line at the end, the macro inserts
  613. * a blank line.
  614.  
  615.  
  616. * This:
  617.  
  618. 19
  619. 24
  620. 1
  621. 385
  622. 173
  623.  
  624. * Becomes this:
  625.  
  626.  19
  627.  24
  628.   1
  629. 385
  630. 173
  631.  
  632. @9 macrobegin
  633.         setscreenoff
  634.     * ------------- Make column block of longest number -------------*
  635.         cursordown prevpara
  636.         begline                                                          *|
  637.         unmarkblock markcolumn endline
  638.      1: cursorleft markcolumn cursordown
  639.         jtrue 2 addline 2:                                               *|
  640.         begline endline jtrue 1
  641.     * ---------------- Insert right position markers ----------------*
  642.         gotoblockend markline gotoblockbeg markcolumn
  643.         prevposition fillblock #173 return prevposition
  644.     * ------------------------ Right justify ------------------------*
  645.      5: delch unmarkblock markcolumn endline markcolumn
  646.         begline moveblock endline cursordown cursorleft
  647.         isemptyline jfalse 5
  648.     * -------------------------- Reposition --------------------------*
  649.         markline prevpara markline shiftleft unmarkblock
  650. *
  651. * 48 bytes Sun  12-08-1991  11:16:30 (TH @F9, to EW #20/24)
  652. * 47 bytes Mon  01-13-1992  09:49:22 (TH @9, removed onewindow)
  653. * 47 bytes Mon  03-30-1992  14:44:08 (TH @9, corrected Label 5)
  654. * 52 bytes Sat  06-13-1992  11:21:22 (TH to LS #21/_____ 6/13)
  655. * 52 bytes Sat  06-13-1992  11:21:22 (TH @9 modified for para at eof *|)
  656.  
  657. * 
  658. * ----------------------------------------------------------------------
  659. * @(0) Left Justify Text in Line or Block to Designated Column
  660. * ----------------------------------------------------------------------
  661. * This macro will left justify the current line or each line of text in
  662. * a line block to a user selected designated column.  Only lines
  663. * containing text from column 1 to the user selected column will be
  664. * left justified.
  665.  
  666. * A line block may be marked before invoking, either open or closed,
  667. * and operation will proceed pausing only to select column to left
  668. * justify to.  This macro will not justify the last line in a file.
  669. * QEdit v2.15 is required.
  670.  
  671. * For example, marking the first four lines without the box and
  672. * asterisks and positioned in column 1, selecting 3 at the gotocolumn
  673. * prompt:
  674.  
  675. *                 ┌────+────┐
  676. *                 │12345    │
  677. *                 │   45678 │
  678. *                 │    56789│
  679. *                 │ 23456   │
  680. *                 │  34567  │
  681. *                 │   45678 │
  682. *                 │    56789│
  683. *                 └─────────┘
  684. * We get...
  685. *                 ┌────+────┐
  686. *                 │   12345 │
  687. *                 │   45678 │
  688. *                 │    56789│
  689. *                 │   23456 │
  690. *                 │  34567  │
  691. *                 │   45678 │
  692. *                 │    56789│
  693. *                 └─────────┘
  694.  
  695. * Note, line 3 is not left justified because it has no text in col's
  696. * 1-3
  697.  
  698.  
  699. @0 macrobegin
  700.         setinsmode
  701.     * ---------------- Mark/Close Block if Not Marked ----------------*
  702.         gotoblockbeg jtrue ok markline
  703.         gotoblockbeg jtrue ok
  704.         pause
  705.         markline
  706.         gotoblockbeg
  707.     ok:
  708.     * ---------------- Select Column to Left Justify ----------------*
  709.         begline gotoblockend
  710.         markcolumn              * Mark 1st char of last line
  711.         prevposition            * Return to block begin
  712.         gotocolumn
  713.         pause
  714.         return
  715.         setscreenoff
  716.         markcolumn              * Close column block
  717.     * ------------------------- Left Justify -------------------------*
  718.     PUSH:
  719.         firstnonwhite
  720.         L5:
  721.             iscursorinblock
  722.             jfalse NEXT_LINE
  723.             " "                 * Push text right 'til none in block
  724.             jump L5
  725.         NEXT_LINE:
  726.             cursordown begline
  727.             iscursorinblock
  728.     jtrue PUSH                  * Are we past block?
  729.         unmarkblock
  730. *
  731. * 43 bytes Wed  06-10-1992  09:07:14 (TH @0)
  732.  
  733. * 
  734. * ----------------------------------------------------------------------
  735. * @(f1)  Right Justify Block Using RJ.COM
  736. * ----------------------------------------------------------------------
  737. * This macro right justifies a marked block or a user selected block
  738. * using RJ.COM.   If a block  is marked before  invoking this macro,
  739. * either open or closed, it will  be processed without pause.  If no
  740. * block is marked, the macro pauses for the user to select the block
  741. * end by  cursoring to  end of  desired block  and pressing <enter>.
  742. * This paragraph  marked as a  block was right  justified using @f1.
  743. * Requires QEdit v2.15.
  744.  
  745. @f1     Macrobegin onewindow
  746. * --------------------------- Select Block ---------------------------*
  747.         gotoblockend jtrue A markline gotoblockend jtrue OK pause jump B
  748.      A: gotoblockbeg unmarkblock markline prevposition
  749.      B: markline
  750.     OK: setscreenoff
  751. * ----------------------- Right Justify Block -----------------------*
  752.         gotoblockbeg
  753.         endline cursorright
  754.         writeblock "c:!" return
  755.             return "o" backspace        * Overwrite block to temp file c:!
  756.         editfile
  757.             endline ".rj" return
  758.             return quit                 * Quit c:!.rj if loaded
  759.         gotoblockbeg
  760.         cut                             * Remove unjustified block
  761.         DOS
  762.             "RJ c:!>c:!.rj"
  763.             return return               * Right justify block to c:!.rj
  764.         readblock return                * Read right justified block c:!.rj
  765.         editfile return killfile quit   * Kill/quit c:!.rj
  766.         gotoblockbeg                    * Return to block begin
  767. *         unmarkblock
  768. *
  769. * 83 bytes Mon  02-25-1991  06:51:47
  770. * 86 bytes Wed  05-13-1992  12:36:37 (TH @F6, modified for all Qconfig's)
  771. * 89 bytes Mon  05-18-1992  12:01:16 (TH @f1, select or process marked block)
  772. * 88 bytes Tue  05-19-1992  11:38:20 (TH @f1, w/o unmarkblock)
  773.  
  774.  
  775. * (Documentation) for RJ.COM
  776. * ------------------------------
  777. *   USAGE: RJ <INFILE> { PRINT_MARGIN F S }
  778. *
  779. *   WHERE: 0=< PRINT_MARGIN =<40  Default = 0 enter like: 8
  780. *          F  FILTERS control chars Default = OFF enter like: F
  781. *          S  SUPPRESS Line Feeds after CR Default = OFF enter
  782.  
  783. *   PURPOSE: RJ  Right Justifies  your printer  output, making  it look
  784. *       professional.   RJ  right  justifies  text  files  by imbedding
  785. *       blanks between words.   It is compatible with  VDE or any other
  786. *       ASCII text editor.  Public domain.
  787.  
  788. *   METHOD: RJ imbeds spaces between  words.  It calculates the longest
  789. *       line in the file (40 to 255 char), then justifies shorter lines
  790. *       (up to 15% shorter ).  Non-printable control characters are not
  791. *       counted for formatting purposes, so  leave them in if you wish.
  792. *       Carriage Returns, Line  Feeds, Form Feeds,  and Tabs are always
  793. *       processed normally  and printed. Indenting  at the beginning of
  794. *       the line is disregarded, but  any line with 3+ IMBEDDED spaces,
  795. *       or any  line with Tabs  is not justified.   This leaves tables,
  796. *       charts, etc.  intact.
  797.  
  798. *   HINTS: All  parameters except INFILE  are optional and  they may be
  799. *       entered in  any order; the  defaults are above.   Note that the
  800. *       input file  is left unaltered;  output defaults  to the screen.
  801. *       This allows  you to preview  your printer output.   To print or
  802. *       copy   your  right  justified  file,  use  the  DOS redirection
  803. *       operator: RJ REPORT.TXT F 6 > PRN.  Save your normal parameters
  804. *       in a batch file.
  805.  
  806. * 
  807. * ----------------------------------------------------------------------
  808. * @(f2) Removes Right Justification From Block
  809. * ----------------------------------------------------------------------
  810. * This  macro removes right  justification added with  @f1 using RJ.COM
  811. * from a marked  block or a user selected  block.  If a block is marked
  812. * before  invoking  this macro,  either  open  or closed,   it  will be
  813. * processed without pause.  If no block is marked, the macro pauses for
  814. * the user to select the block end by cursoring to end of desired block
  815. * and pressing <enter>.  Requires QEdit v2.15.
  816.  
  817. * The macro removes removes right justification from the above as
  818. * follows:
  819.  
  820. * This macro removes right justification added with @f1 using RJ.COM
  821. * from a marked block or a user selected block.  If a block is marked
  822. * before invoking this macro, either open or closed, it will be
  823. * processed without pause.  If no block is marked, the macro pauses for
  824. * the user to select the block end by cursoring to end of desired block
  825. * and pressing <enter>.  Requires QEdit v2.15.
  826.  
  827. @f2     macrobegin onewindow
  828. * --------------------------- Select Block ---------------------------*
  829.         gotoblockend jtrue A markline gotoblockend jtrue OK pause jump B
  830.      A: gotoblockbeg unmarkblock markline prevposition
  831.      B: markline
  832.     OK: setscreenoff
  833. * ------ Make Line Block a Column Block, Exclude Leading Spaces ------*
  834.      1: begline addline "*" #173 gotoblockbeg
  835.      2: isemptyline jfalse 3 cursordown jump 2
  836.      3: firstnonwhite markcolumn endline cursorleft
  837.      4: cursordown isemptyline jtrue 4 isendline jtrue 5 endline cursorleft
  838.      5: markcolumn Find "*" #173 return delline return jfalse 6
  839.         prevposition firstnonwhite iscursorinblock jtrue 4 markcolumn jump 4
  840.      6: delline
  841. * ---------------------- Copy block to Nul file ----------------------*
  842.         editfile "Nul" return quit
  843.         gotoblockbeg cut
  844.         editfile return
  845.         paste
  846. * --------------------- Remove All Extra Spaces ---------------------*
  847.         unmarkblock endline markcolumn
  848.     REMOVE:
  849.         firstnonwhite markcolumn
  850.         findreplace "    " return " " return "ln" return
  851.         findreplace "   "  return     return "ln" return
  852.         findreplace "  "   return     return "ln" return
  853.         endline iscursorinblock jtrue EOL_OK markcolumn
  854.     EOL_OK:
  855.         cursordown jtrue REMOVE
  856. * ---------- Replace 'Period Space' With 'Period Two Spaces ----------*
  857.         begfile
  858.         findreplace "." " "   return "." "  "  return "n" return
  859. * ------------- Paste Block Back Where It Was, Quit Nul -------------*
  860.         copy quit pasteover
  861. *         unmarkblock
  862. *
  863. *  81 bytes Wed  02-20-1991  12:48:50
  864. * 171 bytes Tue  05-19-1992  09:22:38 (TH @f2, select or process marked block)
  865. * 170 bytes Tue  05-19-1992  11:38:57 (TH @f2, w/o unmarkblock)
  866.  
  867. * 
  868. * ----------------------------------------------------------------------
  869. * @(f3) Right Justify File With Same Prefix and ".rj" Extension
  870. *       Using RJ.COM
  871. * ----------------------------------------------------------------------
  872. * This  macro uses  the right  justification  program RJ.COM,  which is
  873. * included and must  be located in current  directory or path, to right
  874. * justify the  current file.  The  right justified  file with extension
  875. * '.rj' is loaded for editing.  Requires QEdit v2.15.
  876.  
  877. * A file may also  be right justified using @f1  by marking the file as
  878. * as block and invoking  @f1.  @f3 differs from  @f1 in that a separate
  879. * rightjustified file with name.rj is loaded for editing.  @f1 replaces
  880. * the marked block with a right  justified block and is faster than @f3
  881. * if c:\ is  a ram drive.   Files with extension  '.rj' cannot be right
  882. * justified.
  883.  
  884. @f3     macrobegin
  885.         unmarkblock begfile insertline  * Insert temp line with
  886.         dropanchor currentfilename      * CurrentFileName marked
  887.         find "." return "b" return      * Find dot backwards
  888.         jfalse NO_EXT                                                      *|
  889.         deltoeol                                                           *|
  890.     NO_EXT:                                                                *|
  891.         ".rj"                           * Add ".rj" after dot
  892.         setscreenoff                                                       *|
  893.         cut                             * Cut name.rj to scrap
  894.         savefile                        * Save file
  895.         DOS
  896.             "RJ " currentfilename       * Right justify file
  897.             ">" paste return return     * To name.rj
  898.         editfile paste return quit      * Quit justified file if loaded
  899.         editfile return                 * Reload justified file
  900. * ----- Remove Right Justification From Last Line in Paragraphs -----*
  901.     REMOVE:
  902.         endpara markcolumn firstnonwhite                                   *|
  903.         findreplace "    " return " " return "ln" return
  904.         findreplace "   "  return     return "ln" return
  905.         findreplace "  "   return     return "ln" return
  906.         unmarkblock cursordown                                             *|
  907.         jtrue REMOVE
  908.         begfile
  909. *
  910. * 106 bytes Wed  02-20-1991  16:28:30
  911. * 101 bytes Tue  05-19-1992  09:02:47 (TH @f3)
  912.  
  913. * 
  914. * ----------------------------------------------------------------------
  915. * @(f4) Removes Right Justification From File
  916. * ----------------------------------------------------------------------
  917. * This  macro removes  right justification  from a  file added  with @f3
  918. * using RJ.COM from a marked block or a user selected block.  If a block
  919. * is marked before  invoking this macro, either  open or closed, it will
  920. * be processed without  pause.  If no block  is marked, the macro pauses
  921. * for the user  to select the block  end by cursoring  to end of desired
  922. * block and pressing <enter>.  Requires QEdit v2.15.
  923.  
  924. @f4     macrobegin
  925.         begfile
  926.         setscreenoff
  927. * --------------------- Remove All Extra Spaces ---------------------*
  928.         unmarkblock endline markcolumn
  929.     REMOVE:
  930.         firstnonwhite markcolumn
  931.         findreplace "    " return " " return "ln" return
  932.         findreplace "   "  return     return "ln" return
  933.         findreplace "  "   return     return "ln" return
  934.         endline iscursorinblock jtrue EOL_OK markcolumn
  935.     EOL_OK:
  936.         cursordown jtrue REMOVE
  937. * ---------- Replace 'Period Space' With 'Period Two Spaces ----------*
  938.         begfile unmarkblock
  939.         findreplace "." " "   return "." "  "  return "n" return
  940. *
  941. * 80 bytes Wed  02-20-1991  12:46:32 (TH @f5)
  942. * 83 bytes Tue  05-19-1992  09:45:17 (TH @f4, shortened)
  943.  
  944. * 
  945. * ----------------------------------------------------------------------
  946. * @(f5) Right Justify File, Screen Preview
  947. * ----------------------------------------------------------------------
  948. * This macro  uses the right  justification program  RJ.COM, which is
  949. * included and must be located in current directory or path, to right
  950. * justify the current  file for screen  preview.  No right jusitified
  951. * file is loaded for editing.
  952.  
  953. @f5 Macrobegin Savefile DOS "RJ " Currentfilename Return
  954. *
  955. * 14 bytes Sun  12-02-1990  01:02:50 (TH, @f5)
  956.  
  957. * 
  958. * ----------------------------------------------------------------------
  959. * @(f7) Left Justify Lines Containing Any Type Block
  960. * ----------------------------------------------------------------------
  961. * This macro will left justify lines containing any type open or closed
  962. * block.
  963.  
  964. @f7     macrobegin gotoblockend jtrue NEXT markline gotoblockend jfalse END
  965.   NEXT: begline gotoblockbeg prevposition begline
  966.         unmarkblock markcolumn prevposition cursorright centerline begline
  967.    END: unmarkblock
  968. *
  969. * 24 bytes Sun  01-12-1992  19:35:58 (TH @f7)
  970.  
  971. * 
  972. * ----------------------------------------------------------------------
  973. * @(f8) Left Justify File
  974. * ----------------------------------------------------------------------
  975. @f8     macrobegin unmarkblock begfile endfile begline
  976.         markcolumn begfile cursorright centerline unmarkblock
  977. *
  978. * 13 bytes Sun  01-12-1992  19:48:18 (TH @f8)
  979.  
  980.